package com.bifrost.cbentity;

import javax.persistence.*;

/**
 * @author rangf
 * @date 2018/2/27
 */
@Entity
@Table(name = "BHWSC_PP")
public class SapBrand {
    private String ppbm;
    private String ppmcZh;
    private String ppzt;
    private String dstatus;
    private String ddate;
    private Long noid;

    @Basic
    @Column(name = "PPBM", nullable = true, length = 6)
    public String getPpbm() {
        return ppbm;
    }

    public void setPpbm(String ppbm) {
        this.ppbm = ppbm;
    }

    @Basic
    @Column(name = "PPMC_ZH", nullable = true, length = 40)
    public String getPpmcZh() {
        return ppmcZh;
    }

    public void setPpmcZh(String ppmcZh) {
        this.ppmcZh = ppmcZh;
    }

    @Basic
    @Column(name = "PPZT", nullable = true, length = 1)
    public String getPpzt() {
        return ppzt;
    }

    public void setPpzt(String ppzt) {
        this.ppzt = ppzt;
    }

    @Basic
    @Column(name = "DSTATUS", nullable = true, length = 1)
    public String getDstatus() {
        return dstatus;
    }

    public void setDstatus(String dstatus) {
        this.dstatus = dstatus;
    }

    @Basic
    @Column(name = "DDATE", nullable = true, length = 14)
    public String getDdate() {
        return ddate;
    }

    public void setDdate(String ddate) {
        this.ddate = ddate;
    }

    @Id
    @SequenceGenerator(name= "sequence",sequenceName="sequence_brand" ,allocationSize=1)
    @GeneratedValue(generator= "sequence",strategy= GenerationType.SEQUENCE)
    @Column(name = "NOID", nullable = false, precision = 0)
    public Long getNoid() {
        return noid;
    }
    public void setNoid(Long noid) {
        this.noid = noid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SapBrand sapBrand = (SapBrand) o;

        if (noid != sapBrand.noid) return false;
        if (ppbm != null ? !ppbm.equals(sapBrand.ppbm) : sapBrand.ppbm != null) return false;
        if (ppmcZh != null ? !ppmcZh.equals(sapBrand.ppmcZh) : sapBrand.ppmcZh != null) return false;
        if (ppzt != null ? !ppzt.equals(sapBrand.ppzt) : sapBrand.ppzt != null) return false;
        if (dstatus != null ? !dstatus.equals(sapBrand.dstatus) : sapBrand.dstatus != null) return false;
        if (ddate != null ? !ddate.equals(sapBrand.ddate) : sapBrand.ddate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = ppbm != null ? ppbm.hashCode() : 0;
        result = 31 * result + (ppmcZh != null ? ppmcZh.hashCode() : 0);
        result = 31 * result + (ppzt != null ? ppzt.hashCode() : 0);
        result = 31 * result + (dstatus != null ? dstatus.hashCode() : 0);
        result = 31 * result + (ddate != null ? ddate.hashCode() : 0);
        result = 31 * result + (int) (noid ^ (noid >>> 32));
        return result;
    }
}
